home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 204 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: news.iag.net!news
  2. From: jatmon@iag.net (John R Buchan)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: SYSTEM CALL RESULT
  5. Date: 3 Jan 1996 08:56:24 GMT
  6. Organization: The Internet Access Group, Inc.
  7. Distribution: world
  8. Message-ID: <4cdgbo$c1e@news.iag.net>
  9. References: <4cbn2i$env@bisance.citi2.fr> <820609309snz@intellic.demon.co.uk>
  10. NNTP-Posting-Host: pm1-orl17.iag.net
  11. Mime-Version: 1.0
  12. Content-Type: Text/Plain; charset=US-ASCII
  13. X-Newsreader: WinVN 0.99.6
  14.  
  15. In article <820609309snz@intellic.demon.co.uk>, truemanc@intellic.demon.co.uk 
  16. says...
  17. >
  18. >In article <4cbn2i$env@bisance.citi2.fr>
  19. >           labed@math-info.univ-paris5.fr "A.Labed" writes:
  20. >
  21. >>
  22. >>Hi,
  23. >>
  24. >>Is there a way to get the result of a
  25. >>system call within a C program. 
  26. >>example :
  27. >
  28. >
  29. >The exit value of a process is returned by the system call. Therefore
  30. >if you wrote a small script which computed the line count of the
  31. >current list of processes and then exited with this value you could
  32. >pick it up as the return value of the system call.
  33.  
  34. Maybe, on your current system with your current compiler, but, if anything
  35. changes, all bets are off. 
  36.  
  37. K&R II - B5 - P253:
  38.  
  39. int system( const char *s)
  40.    system passes the string s to the environment for execution.  If s is 
  41.    NULL, system returns non-zero if there is a command processor.  If s 
  42.    is not NULL, the return value is implementation-dependent.
  43.  
  44. -- 
  45. John R Buchan           -:|:-     Looking for that elusive FAQ?  ftp to:
  46. jatmon@mail.iag.net     -:|:-     rtfm.mit.edu /pub/usenet-by-group/....
  47.  
  48.